package com.gitee.wsl.ext.map

fun <K> MutableMap<K, Int>.incr(key: K, delta: Int = +1): Int {
    val next = this.getOrPut(key) { 0 } + delta
    this[key] = next
    return next
}